strerror is now thread safe#8648
Conversation
|
I don't think the failing check reached my code. Can I run it again ? |
|
This page: Says: |
|
Hmm.
How hard do we wish to work to avoid false-positives ? I don't know whether other platforms have similar man-pages that could be used to generate a list for each platform. That might allow us to ship multiple lists and let the user select which ones they wish to be warned about ? On the other hand; are how important is it to find POSIX issues as well C/C++ problems in user's code ? |
|
Because it's a "warning" it's a false positive for those that uses glibc and that is not nice. We could change the severity to "portability" for functions where the standard does not clearly say if it's thread safe or not. It is not a false positive to say that it's a portability issue. if we add "strerror" as a symbolname to the error message then users will be able to suppress such portability warnings for this function. |
Before glibc 2.32,
strerror() is not MT-Safe.(from man strerror on Ubuntu 26.04).
glibc 2.32 was released on 2020-08-05 and glibc 2.43 on 2026-01-24
(from https://sourceware.org/glibc/wiki/Glibc%20Timeline)
This patch stops the
threadsafety.pyaddon from warning aboutstrerror().strerrorwas used intest/cli/other_test.pyto testthreadsafety.pyso we also patch that to use a different thread-unsafe function.